-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix markdownlint execution in the CI pipeline #154
Conversation
cf26b3b
to
e32169b
Compare
Grr, the checks are not running for some reason :( |
e32169b
to
a73409b
Compare
One still isn't. Formatting the changelog PR reference with [] instead of an actual link at the end of the file seems to cause the error, and also deviates from what we've done until now. Try with the old mechanism? |
That's deliberate, actually. It turns out that markdownlint is not able to detect the missing link target in reference links when we use the shortcut syntax I'm no longer blocked but I ran out of time. 😅 I'll get back to experimenting with this PR ASAP. |
Well, in that case, I think I'll go ahead to prepare v1.1 with the missing link, and this PR can be wrapped up later. It doesn't need to hold up the release. But no longer having to expand the long link list in the future would be nice indeed. I'm just wondering whether the collapsed link will find the PRs in the original repo, even when viewing the changelog in our forks? |
Why keep the missing link in the release? I would fix the link which we have already detected as missing, since that is orthogonal to the automated detection of future missing links.
Oh, sorry, I'm afraid I gave you the wrong impression. The list at the end of the file still needs to be there regardless of whether we use the |
My bad wording, I meant: "prepare v1.1 while adding the missing link" Oh, okay, I had the impression the new syntax would magically link the PR somehow. Carry on then. 😄 |
c20230d
to
fe47fbf
Compare
Ok, I think I've got this pretty much ready. Now we just need to wait for a new release of markdownlint-cli or markdownlink-cli2 that includes support for markdownlint 0.31.0 (the version that introduced support for the shortcut syntax checking I asked for as mentioned above — thanks @DavidAnson!). Afterwards (and upon confirming that the markdownlint-problem-matcher action does indeed detect a missing URL error in |
Soon! |
0c9c2b1
to
2157af7
Compare
As mentioned in <https://github.com/igorshubovych/markdownlint-cli#globbing>: > `markdownlint-cli` supports advanced globbing patterns like `**/*.md`. > With shells like Bash, it may be necessary to quote globs > so they are not interpreted by the shell.
By default, markdownlint detects missing link targets in reference links written in the "collapsed syntax" `[foo][]`, but not if they use the "shortcut syntax" [foo]. Since markdownlint 0.31.0, the rule MD052/reference-links-images now supports a `shortcut_syntax` boolean parameter that allows opting-in to checking shortcut syntax links as well. This requires markdownlint-cli v0.37.0 or above, but since our GitHub Actions setup fetches the latest available version, we already have access to it in the CI pipeline, so we only need to add the rule and parameter in the markdownlint configuration file.
b64b94a
to
4cd37b0
Compare
Alright! Now that markdownlint-cli has gotten a new release that includes markdownlint 0.31.0 (and therefore supports the new I have confirmed that an undefined URL reference does produce a markdownlint violation in the CI with the new config option. After that test I reverted the violation, naturally. I also cleaned up the commits and renamed the PR to be more accurate. @Xymph this should now be ready to merge — please take a look at your convenience! |
Lookin' good. 👍 |
Follow up from the conversation from #153.
The advanced glob expression we were using needs to be quoted, as explained in https://github.com/igorshubovych/markdownlint-cli#globbing: